#ifndef IMAGEITEM_H
#define IMAGEITEM_H

#include <QGraphicsItem>

class ImageItem : public QGraphicsItem
{
public:
    explicit ImageItem(const QImage &image,const QRect rect);

    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    virtual QRectF boundingRect() const;

    void setImage(const QImage &image)
    {
        m_image = image;
        update();
    }
public:
    QImage  m_image;
    QRect   m_rect;
};

#endif // IMAGEITEM_H
